Xbasic

INET::FTPReceiveFile Method

Syntax

.ReceiveFile as L (SourceFile as C, TargetFile as C [, SendBinary as L])

Arguments

SourceFileCharacter

The server file to receive.

TargetFileCharacter

The local target file name.

ReceiveBinaryLogical

Default = .t.. Contents of file are received as binary. Set to .f. to receive the file contents as text data.

Returns

resultLogical

Returns .t. if the operation succeed. Otherwise, returns .f.. If an error occurred, the INET::FTP CallResult property will contain more information.

Description

Receive a file from the server. Contents are received as binary unless ReceiveBinary is set to .f.

Example

dim ftp as INET::FTP
ftp.UserName   = "Fred"
ftp.Password   = "Secret"
ftp.EnableSSL  = .t.
ftp.Host       = "ftp.myserver.com"
ftp.UsePassive = .t.

if ftp.ReceiveFile("myData.csv","target.csv") <> .t.
    ' error
    msg = ftp.callResult.error
    ...
end if